package com.tang.managementdemo.util;

public class CurrentHolder {
    private static ThreadLocal<Integer> threadLocal = new ThreadLocal<>();
    private static ThreadLocal<String> threadLocalName = new ThreadLocal<>();
    public static void setCurrentId(Integer employeeId){
        threadLocal.set(employeeId);
    }
    public static Integer getCurrentId(){
        return threadLocal.get();
    }
    public static void setCurrentName(String employeeName){
        threadLocalName.set(employeeName);
    }
    public static String getCurrentName(){
        return threadLocalName.get();
    }
    public static void remove(){
        threadLocal.remove();
    }
}
